﻿package mortal.game.view.copy.ChallengeCopy.view
{
    import com.gengine.global.*;
    import com.mui.utils.*;
    import flash.events.*;
    import flash.utils.*;
    import mortal.common.swfPlayer.*;
    import mortal.common.swfPlayer.data.*;
    import mortal.game.manager.*;
    import mortal.mvc.core.*;

    public class ChallengeFightGuide extends View
    {
        private var _swf:SWFPlayer;
        private var _timer:Timer;

        public function ChallengeFightGuide()
        {
            super.layer = LayerManager.windowLayer;
            return;
        }// end function

        override public function show(param1:int = 0, param2:int = 0) : void
        {
            super.show(param1, param2);
            this.x = Global.stage.stageWidth / 2 + 100;
            this.y = Global.stage.stageHeight / 2 + 240;
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._timer = new Timer(6000, 1);
            this._timer.addEventListener(TimerEvent.TIMER_COMPLETE, this.timerHandler);
            this._timer.start();
            this._swf = UICompomentPool.getUICompoment(SWFPlayer);
            this._swf.timeRate = 3;
            this._swf.load("ChallengeFightGuide.swf", ModelType.NormalSwf, null);
            this.addChild(this._swf);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            if (this._timer != null)
            {
                this._timer.removeEventListener(TimerEvent.TIMER_COMPLETE, this.timerHandler);
                this._timer.stop();
                this._timer = null;
            }
            this._swf.dispose(true);
            this._swf = null;
            return;
        }// end function

        private function timerHandler(event:TimerEvent) : void
        {
            hide();
            return;
        }// end function

    }
}
